// pages/z/z.js
const app = getApp(); // 获取全局变量
const db = wx.cloud.database(); //初始化数据库
Page({

  /**
   * 页面的初始数据
   */
  data: {
    a: '',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
     // 过审核
     const that = this
     db.collection("a").get()
       .then(res => {
         console.log("11111111", res.data[0].a)
         that.setData({
           a: res.data[0].a,
         })
       })

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this;

    setTimeout(function () {
      app.slideupshow(this, 'slide_up1', 10, 1)
    }.bind(this), 800);


    setTimeout(function () {
      app.slideupshow(this, 'slide_do1', 0, 0)
    }.bind(this), 100);
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  // 饿了么红包
  goto() {
    wx.navigateToMiniProgram({
      appId: 'wxece3a9a4c82f58c9',
      path: 'commercialize/pages/taoke-guide/index?scene=0c6958b5edc449c4b467c8347cfac9aa',

    })
  },
  // 美团红包
  goto1() {
    wx.navigateToMiniProgram({
      appId: 'wxde8ac0a21135c07d',
      path: '/index/pages/h5/h5?lch=cps:waimai:5:65c5f4b9271221c79eae104d969a48a3:33162jutuike123456:33:85459&weburl=https%3A%2F%2Fdpurl.cn%2FJQG4Wg5z&f_userId=1&f_token=1',

    })
  },


  // 大牌餐券
  goto2() {
    wx.navigateToMiniProgram({
      appId: 'wx89752980e795bfde',
      path: '/pages/food/food?pub_id=33162&sid=123456&source=jutuike',

    })
  },
  // 唯品会
  goto3() {
    wx.navigateToMiniProgram({
      appId: 'wxe9714e742209d35f',
      path: 'pages/index/index?tra_from=adp%3AC01V4migjprhjl1o%3A%3Amig_code%3A33162jutuike123456%3Aac03164migjp0000jinngo067e9rc3zr&chl_type=wxk',

    })
  },

  // 拼多多
  goto4() {
    wx.navigateToMiniProgram({
      appId: 'wxa918198f16869201',
      path: '/pages/web/web?specialUrl=1&src=https%3A%2F%2Fmobile.yangkeduo.com%2Fduo_transfer_channel.html%3FresourceType%3D4%26pid%3D8516041_141204175%26customParameters%3D33162jutuike123456%26authDuoId%3D8516041%26cpsSign%3DCE_220826_8516041_141204175_0710889c2e017928c1e9970592e14b40%26_x_ddjb_act%3D%257B%2522st%2522%253A%25226%2522%257D%26duoduo_type%3D2',

    })
  },

  // 滴滴打车
  goto5() {
    wx.navigateToMiniProgram({
      appId: 'wxaf35009675aa0b2a',
      path: '/pages/index/index?scene=Ox7Lxea&source_id=33162jutuike123456',

    })
  },

  // 肯德基
  goto6() {
    wx.navigateToMiniProgram({
      appId: 'wx89752980e795bfde',
      path: '/pages/index/index?pub_id=33162&sid=123456&act_id=38&source=jutuike',

    })
  },

  /* 分享到朋友圈 */
  onShareTimeline: function (item) {
    return {
      title: '小宝优惠券',
      imageUrl: 'https://c-ssl.dtstatic.com/uploads/blog/202112/19/20211219235040_c4c30.thumb.1000_0.jpg'
    }
  },

 // 返回 
 return() {
  wx.switchTab({
    url: '/pages/get/get',
  })

 }

})